{% extends "base.html" %}
{% block breadcrumb_current %}
    库存管理 > 物料审批记录
{% endblock %}
{% block content %}
    <div class="bg-light p-3 shadow-sm">
        <h5 style="color: #417690;">
            {{ inventory.warehouse.warehouse }}-{{ inventory.material.material }}最近50条出入库审批记录
            <a href="{% url 'inventory_list' %}" class="btn btn-secondary btn-sm float-end">返回物料清单</a></h5>
        </div>
    <div>
<div class ="container mt-4">
    <table class="table table-hover" style="margin-top: 15px;">
        <thead>
            <tr>

                <th>出入方式</th>
                <th>摘要</th>
                <th>原有</th>
                <th>本次</th>
                <th>之后</th>
                <th>申请日期</th>

                <th>审批</th>

            </tr>
        </thead>
        <tbody >
            {% if records %}
                {% for record in records %}
                    <tr class="custom-row-color">

                        <td>{{ record.get_operatemode_display }}</td>
                        <td>{{ record.reason }}</td>
                        <td>{{ record.quantity_before }}</td>
                        <td>{{ record.quantity }}</td>
                        <td>{{ record.quantity_after }}</td>
                        <td>{{ record.operatedate|date:"Y-m-d" }}</td>

                        <td>{{ record.get_approvalstatus_display }}</td>

                    </tr>
                {% endfor %}
            {% else %}
                <tr><td colspan="5" class="text-center">暂无记录</td></tr>
            {% endif %}
        </tbody>
    </table>
</div>
{% endblock %}